import unittest
from api.emplopyee import *

class TestEmployee(unittest.TestCase):
    employee_id = None
    def setUp(self):
        self.employee_api = EmployeeAPI()
    def test01_add_employee(self):
        add_emplopyee_data = {
            "username": "jack0709t0728007",
            "mobile": "13212072804",
            "timeOfEntry": "2020-07-09",
            "formOfEmployment": 1,
            "workNumber": "072804",
            "departmentName": "销售",
            "departmentId": "1266699057968001024",
            "correctionTime": "2020-07-30T16:00:00.000Z"
        }
        response = self.employee_api.add_emplopyee(add_emplopyee_data = add_emplopyee_data)
        print(response.json())
        self.assertEqual(200, response.status_code)
        self.assertIn(True, response.json().get("success"))

        #提取员工id
        TestEmployee.employee_id = response.json().get("data").get("id")











